package cn.iocoder.yudao.module.handguard.dal.mysql.homeone;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.homeone.HomeOneDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.admin.homeone.vo.*;

/**
 * 首页成交榜-即使滚动数据 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface HomeOneMapper extends BaseMapperX<HomeOneDO> {

    default PageResult<HomeOneDO> selectPage(HomeOnePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HomeOneDO>()
                .eqIfPresent(HomeOneDO::getTitle, reqVO.getTitle())
                .betweenIfPresent(HomeOneDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HomeOneDO::getId));
    }

    default List<HomeOneDO> selectList(HomeOneExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<HomeOneDO>()
                .eqIfPresent(HomeOneDO::getTitle, reqVO.getTitle())
                .betweenIfPresent(HomeOneDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HomeOneDO::getId));
    }

    void deleteHomeOneAll();
}
